Microsoft Office 365: Automatically adding safe senders to Microsoft Outlook

This guide describes how to create and run scripts to automatically add safe senders to each of your user's Safe Senders list in Microsoft Outlook.

When you add new users to your Microsoft 365 environment, the BullPhish ID sending domains will be added to the new users' Safe Senders list automatically.

Prerequisites

  • You must have already completed the section Configuring Microsoft 365 Defender in the article, Microsoft Office 365 safelisting guide .
  • To run scripts, you must have a Windows machine. 
  • To run scripts in the background, you must have PowerShell v7 installed. 
  • You must access Azure Active Directory to create an unattended authentication mechanism.
  • In this guide, you are instructed to download files and create and save new files. It is recommended that you create a local directory on your system in which to place these files.

IMPORTANT  After completing the steps in this article, you must go back to the Microsoft Office 365 safelisting guide and complete the following sections:
- Preventing Microsoft Defender from rewriting BullPhish ID campaign links.
- Preventing an email non-delivery error.

Set up app-only authentication

An initial onboarding is required for authentication using application objects. Application and service principal are used interchangeably, but an application is like a class object while a service principal is like an instance of the class. You can learn more about this at Application and service principal objects in Azure Active Directory.

How to automatically adding safe senders to Microsoft Outlook

 

Revision Date
Title changed from Microsoft Office 365 Automatic Safelisting Guide to Microsoft Office 365: Automatically adding safe senders to Microsoft Outlook.
Prereqs: Added - Must complete section Configuring Microsoft 365 Defender in the article, Microsoft Office 365 Safelisting Guide.
Tested, updated all steps, screenshots.
11/30/23
Step 8: Edit the Config.ps1 file: Edited Step 15: Wording for CertificatePassword, added screenshot. 2/28/24